<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
	    <!-- Loading Bootstrap -->
	    <link href="./Public/Admin/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
	    <!-- Loading Flat UI -->
	    <link href="./Public/Admin/Flat/dist/css/flat-ui.css" rel="stylesheet">
	    <link href="./Public/Admin/Flat/docs/assets/css/demo.css" rel="stylesheet">
	    <link rel="shortcut icon" href="./Public/Admin/Flat/img/favicon.ico">
	    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
	    <!--[if lt IE 9]>
	      <script src="dist/js/vendor/html5shiv.js"></script>
	      <script src="dist/js/vendor/respond.min.js"></script>
	    <![endif]-->
	</head>
	<body>
		<table class="table table-bordered">
			<tr class="active">
			  <th width="60">货品ID</th>
			  <?php foreach ($data as $v){?>
			  <th><?php echo $v['aname']?></th>
			  <?php }?>
			  <th>库存</th>
			  <th>货号</th>
			  <th>操作</th>
			</tr>
			<?php foreach ($dataAttr as $v){?>
			<tr>
				<td><?php echo $v['lid']?></td>
				<?php foreach ($v['groupAttr'] as $value){?>
				<td><?php echo $value?></td>
				<?php }?>
				<td><?php echo $v['stock']?></td>
				<td><?php echo $v['gnum']?></td>
				<td>
					<a href="<?php echo U('Goodslist/edit',array('lid'=>$v['lid'],'gid'=>Q('get.gid',0,'intval'),'tid'=>Q('get.tid',0,'intval')))?>" class="btn btn-sm btn-warning">编辑</a>
					<a href="javascript:if(confirm('确定到删除吗？'))location.href='<?php echo U('Goodslist/del',array('lid'=>$v['lid'],'gid'=>Q('get.gid',0,'intval'),'tid'=>Q('get.tid',0,'intval')))?>';" class="btn btn-sm btn-danger">删除</a>
				</td>
			</tr>
			<?php }?>
			<form action="" method="post">
			<tr>
				<td>添加货品</td>
				<?php foreach ($data as $v){?>
				<td>
					<select name="groupAttr[]" id="" class="form-control">
						<?php foreach ($v['value'] as $value){?>
						<option value="<?php echo $value['gaid']?>"><?php echo $value['goodsvalue']?></option>
						<?php }?>
					</select>
				</td>
				<?php }?>
				<td>
					<input type="text" name="stock" id="">
				</td>
				<td>
					<input type="text" name="gnum" id="">
				</td>
				<td>
				</td>
			</tr>
		</table>
		<input type="hidden" name="goods_gid" value="<?php echo Q('get.gid','0','intval')?>">
		<button class="btn btn-success btn-block">添加</button>
		</form>
		<!-- <nav>
			<center>
				<ul class="pagination" style="background:#81A3C4">
					<?php if($total > 2) :?>
						<?php echo $page?>
					<?php endif ?>
				</ul>
			</center>
		</nav> -->
	</body>
</html>
